package cn.hdu.liang.observer.weather;

public class HeatIndexDisplay implements Observer, DisplayElement {

    private double temp;
    private double humidity;
    private Subject weatherData;

    public HeatIndexDisplay(Subject weatherData) {
        this.weatherData = weatherData;
        weatherData.registerObserver(this);
    }

    @Override
    public void display() {
        System.out.println("酷热指数是： " + temp + " " + humidity);
    }

    @Override
    public void update(double temp, double humidity, double pressure) {
        this.temp = temp;
        this.humidity = humidity;
    }
}
